package com.bocloud.cmp.dao;

import java.util.List;
import java.util.Map;

import com.bocloud.cmp.entity.resource.Flavor;
import com.bocloud.common.model.Param;

/**
 * 配置DAO接口
 * 
 * @author dongkai
 *
 */
public interface FlavorDao {

	/**
	 * 保存
	 * 
	 * @param flavor
	 * @return
	 * @throws Exception
	 */
	public Flavor save(Flavor flavor) throws Exception;

	/**
	 * 列表展示
	 * 
	 * @param page
	 * @param rows
	 * @param params
	 * @param sorter
	 * @return
	 * @throws Exception
	 */
	public List<Flavor> list(int page, int rows, List<Param> params, Map<String, String> sorter) throws Exception;

	/**
	 * 查询所有
	 * 
	 * @param vendorId
	 * @return
	 * @throws Exception
	 */
	public List<Flavor> listByVendorId(Long vendorId) throws Exception;

	/**
	 * 查询数量
	 * 
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public int count(List<Param> params) throws Exception;

	/**
	 * 根据FlavorID查询
	 * 
	 * @param flavorId
	 * @return
	 * @throws Exception
	 */
	public Flavor getByFlavorId(String flavorId) throws Exception;

	/**
	 * 根据名称查询
	 * 
	 * @param name
	 * @return
	 * @throws Exception
	 */
	public Flavor getByName(String name) throws Exception;

	/**
	 * 根据VendorId和name查询
	 * 
	 * @param vendorId
	 * @param name
	 * @return
	 * @throws Exception
	 */
	public Flavor getByVid(Long vendorId, String name) throws Exception;

	/**
	 * 根据ID查询
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public Flavor query(Long id) throws Exception;

	/**
	 * 更新
	 * 
	 * @param flavor
	 * @return
	 * @throws Exception
	 */
	public Boolean update(Flavor flavor) throws Exception;

	/**
	 * 删除
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public Boolean delete(Long id) throws Exception;

	/**
	 * 根据云供应商ID删除
	 * 
	 * @param vendorId
	 * @return
	 * @throws Exception
	 */
	public boolean removeByVid(Long vendorId) throws Exception;
}
